|
Color Math Library
0.9
Library for working with colors and color components
|
#include <propeller.h>#include <stdlib.h>Go to the source code of this file.
Functions | |
| int | compareRRGGBB (int c1, int c2) |
| Compares two 24-bit (RRGGBB) colors and returns a value proportional to how similar they are. More... | |
| int | getColorRRGGBB (int r, int g, int b) |
| Generates a single 24-bit (RRGGBB) color integer from individual 8-bit red, green, and blue componenets. More... | |
| int | get8bitColor (int c, char *i) |
| Retrives the specified 8-bit (red, green, or blue) color component from a 24-bit (RRGGBB) color integer. More... | |
| int | remapColor (int c, char *f1, char *f2) |
| Remaps a color stored as a simgle integer. More... | |
| int compareRRGGBB | ( | int | c1, |
| int | c2 | ||
| ) |
Compares two 24-bit (RRGGBB) colors and returns a value proportional to how similar they are.
| c1 | The first 24-bit color to be compared. |
| c2 | The second 24-bit color to be compared. |
| int get8bitColor | ( | int | c, |
| char * | i | ||
| ) |
Retrives the specified 8-bit (red, green, or blue) color component from a 24-bit (RRGGBB) color integer.
| c | A 24-bit (RRGGBB) color integer. |
| *i | A string indicating which color component should be returned: "RED", "GREEN", or "BLUE". The strings "R", "G", or "B" are acceptable. |
| int getColorRRGGBB | ( | int | r, |
| int | g, | ||
| int | b | ||
| ) |
Generates a single 24-bit (RRGGBB) color integer from individual 8-bit red, green, and blue componenets.
| r | An 8-bit value (0-255) representing the red component of a color. |
| g | An 8-bit value (0-255) representing the green component of a color. |
| b | An 8-bit value (0-255) representing the blue component of a color. |
| int remapColor | ( | int | c, |
| char * | f1, | ||
| char * | f2 | ||
| ) |
Remaps a color stored as a simgle integer.
| c | The color stored as an integer to be remapped. |
| *f1 | A string specifying the format of the color inputted. For example, a string indicating an 24-bit color integer with 8 red bits, 8 green bits, and 8 blue bits would be "8R8G8B". A 16-bit color integer with 5 red bits, 6 green bits, and 5 blue bits would be "5R6G5B". |
| *f2 | A string specifying the format of the color to be returned. The order of the color components does not have to be the same as the input order. For example, this function can be used to simply re-order the color components. |
1.8.11